package com.xxx.video.main.adapters;

import android.content.Context;
import android.view.View;

import androidx.annotation.NonNull;

import com.xxx.video.R;
import com.xxx.video.commen.adapters.BaseRecycleViewAdapter;
import com.xxx.video.commen.adapters.BaseViewHolder;

import butterknife.OnClick;

public class HomeIndexTypeListAdapter extends BaseRecycleViewAdapter<Object, HomeIndexTypeListAdapter.MyHolder> {


    public HomeIndexTypeListAdapter(@NonNull Context context) {
        super(context);
    }

    @Override
    public HomeIndexTypeListAdapter.MyHolder onCreateDefaultViewHolder(View view, int viewType) {
        return new HomeIndexTypeListAdapter.MyHolder(view);
    }

    @Override
    public int getItemLayout(int viewType) {
        return R.layout.item_home_index_fragment_type_list;
    }

    @Override
    public int getItemCount() {
        return 1;
    }

    @Override
    public boolean isSetBaseItemViewClickListener() {
        return false;
    }

    class MyHolder extends BaseViewHolder {

        public MyHolder(View itemView) {
            super(itemView);
        }

        @Override
        public void setData2View(int position) {

        }

        @OnClick({R.id.tv_item_home_index_fragment_type_ranking, R.id.tv_item_home_index_fragment_type_week})
        public void onViewClicked(View view) {
            switch (view.getId()) {
                case R.id.tv_item_home_index_fragment_type_ranking:
                    if (onItemClickListener != null) {
                        onItemClickListener.onItemClick(null, 0, 0);
                    }
                    break;
                case R.id.tv_item_home_index_fragment_type_week:
                    if (onItemClickListener != null) {
                        onItemClickListener.onItemClick(null, 0, 1);
                    }
                    break;
                default:
                    break;
            }
        }

    }
}
